//----------------------------------------------------------------------------
//  ,-.
// /_\___ ,   CA Framework
// '  ___\    (C) Riccardo Capra - http://riccar.do
//  //   \\
//----------------------------------------------------------------------------
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------------

#ifndef NJ_MEM_UTILS_WIN_INLINE_H
#	define NJ_MEM_UTILS_WIN_INLINE_H

	//----------------------------------------------------------------------------
	inline void NjMemUtils::Copy(void * pDest, NjUint uDestSize, void const * pSour, NjUint uSourSize)
	{
		NJ_ASSERT(pDest!=NJ_NULL || uDestSize==0);
		NJ_ASSERT(pSour!=NJ_NULL || uSourSize==0);
		NJ_ASSERT(uDestSize>=uSourSize);
		memcpy_s(pDest, uDestSize, pSour, uSourSize);
	}
	//----------------------------------------------------------------------------
	inline void NjMemUtils::Set(void * pDest, NjUint uDestSize, NjUint8 uValue)
	{
		NJ_ASSERT(pDest!=NJ_NULL || uDestSize==0);
		std::memset(pDest, uValue, uDestSize);
	}
	//----------------------------------------------------------------------------
	inline void NjMemUtils::Move(void * pDest, NjUint uDestSize, void const * pSour, NjUint uSourSize)
	{
		NJ_ASSERT(pDest!=NJ_NULL || uDestSize==0);
		NJ_ASSERT(pSour!=NJ_NULL || uSourSize==0);
		NJ_ASSERT(uDestSize>=uSourSize);
		memmove_s(pDest, uDestSize, pSour, uSourSize);
	}
	//----------------------------------------------------------------------------
	inline NjInt NjMemUtils::Compare(void const * pLeft, void const * pRight, NjUint uSize)
	{
		NJ_ASSERT((pLeft!=NJ_NULL && pRight!=NJ_NULL) || uSize==0);
		return std::memcmp(pLeft, pRight, uSize);
	}
	//----------------------------------------------------------------------------

#endif // NJ_MEM_UTILS_WIN_INLINE_H
